﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CourseSystem.Core.Entities;
using CourseSystem.Core.SqlServerDAL;

namespace CourseSystem.Core.BLL
{
    public class GradeYearBLL
    {
        public static List<GradeYearInfo> GetAll()
        {
            using (var dal = new GradeYearDAL(Settings.ConnectionName))
            {
                var re = dal.Select(o => true);
                return re;
            }
        }

        public static GradeYearInfo Get(int value)
        {
            using (var dal = new GradeYearDAL(Settings.ConnectionName))
            {
                var re = dal.SelectSingle(o => o.Year==value);
                return re;
            }
        }

        public static GradeYearInfo GetById(int value)
        {
            using (var dal = new GradeYearDAL(Settings.ConnectionName))
            {
                var re = dal.SelectSingle(o => o.Id == value);
                return re;
            }
        }
    }
}
